﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WBrowser
{
    public partial class FilterForum : Form
    {
        private string filter { get; set; }
        public Links _parentForm;
        public FilterForum(Links parent)
        {
            InitializeComponent();
            _parentForm = parent;
        }

        
        private void btnFilter_Click(object sender, EventArgs e)
        {
            string join = " and ";
            if (textBoxLanguage.Text != "")
                filter += join + "(" + textBoxLanguage.Text + ")";
            if (textBoxContent.Text != "")
                filter += join + "(" + textBoxContent.Text + ")";
            if (textBoxType.Text != "")
                filter += join + "(" + textBoxType.Text + ")";

            filter = filter.Substring(join.Length);
            _parentForm.checkForumsBindingSource.Filter = filter;
        }
    }
}
